package ItemSystem;

import org.newdawn.slick.Input;
import org.newdawn.slick.geom.Vector2f;

import entity.Player;

public class MeleeWeapon extends Item
{
	private int damage;
	private int range;
	
	public MeleeWeapon(Vector2f position, String itemName, int damage, int range)
	{
		super(position, itemName);
		this.setDamage(damage);
		this.setRange(range);
	}
	
	public void update(Player user) 
	{
		super.update(user);
		
		if (user.getInput().isMousePressed(Input.MOUSE_LEFT_BUTTON))
		{
			attack(user.getInput());
		}
		
		if (user.getInput().isMousePressed(Input.MOUSE_RIGHT_BUTTON))
		{
			//block(); maybe?
		}
	}

	private void attack(Input input)
	{
		// This would have to work with the world or collision in some way I think
		
	}

	public int getDamage() 
	{
		return this.damage;
	}

	public void setDamage(int damage) 
	{
		this.damage = damage;
	}

	public int getRange() 
	{
		return range;
	}

	public void setRange(int range) 
	{
		this.range = range;
	}
}
